<template>
	<view class="">


		<view class="bg-white" v-if="gallery.content_data">
			<image class="cover" v-if="gallery.content_data.photo" :src=" gallery.content_data.photo[0] + '?imageView2/2/w/1000'"
			 mode="widthFix"></image>
			<view class="padding-sm margin-bottom-sm">

				<view class="padding-sm">-{{gallery.content_data.name}}-</view>

				<view class="margin-left-sm">
					<text class="text-red text-lg">¥ {{gallery.content_data.price}} </text> 
					<text class="text-sm margin-left-sm">定金 ¥ {{gallery.content_data.deposit}} </text> </view>

			</view>
			<view class="line"></view>
			<view class="cu-bar bg-white margin-top ">
				<view class="action">
					<text class="cuIcon-title text-blue"></text>服务详情
				</view>
			</view>
			<view class="padding" style="padding-top: 0;">
				<text>{{gallery.content_data.desc}}</text>
			</view>
			<view class="line"></view>

			<view class="cu-bar bg-white margin-top ">
				<view class="action">
					<text class="cuIcon-title text-blue"></text>温馨提示
				</view>
			</view>
			<view class="padding" style="padding-top: 0;">
				<text>{{gallery.content_data.tip}}</text>
			</view>
			<view class="line"></view>

			<view class="cu-bar bg-white margin-top ">
				<view class="action">
					<text class="cuIcon-title text-blue"></text>须知
				</view>
			</view>
			<view class="padding" style="padding-top: 0;">
				<text>{{gallery.content_data.notice}}</text>
			</view>
			<view class="line"></view>
		</view>
		<view class="bottom-fix-h"></view>
		<view class="cu-bar bg-white tabbar border shop bottom-fix">
			<view class="action text-gray" @click="openurl('/pages/index/index','switchTab')">
				<view class="cuIcon-home"></view> 首页
			</view>

			<button class="action text-gray" open-type="contact">
				<view class="cuIcon-service ">

				</view>
				客服
			</button>


			<view @click="openurl('/pages/post/joinhands')"  class="bg-red submit">立即预约</view>
		</view>
	</view>
</template>

<script>
	import beeApp from '../../beeApp.js';

	export default {

		data() {
			return {

				userInfo: {},
				page: 1,
				loading: 0,
				loadingType: 'more',
				gallery: {},



			};
		},

		onLoad(option) {
			// beeApp.alert("yiqwyei");
			// this.getLeastUrls();
			this.id = option.id;
			this.load();

		},
		onPullDownRefresh() {
			this.load("reload");
			uni.stopPullDownRefresh();
		},

		methods: {
			//轮播图切换修改背景色
			swiperChange(e) {
				const index = e.detail.current;
				this.swiperCurrent = index;

			},
			ViewImage(url) {
				uni.previewImage({
					urls: this.carouselList,
					current: url
				});
			},
			openurl(url, type) {
				if (type == "switchTab") {
					uni.switchTab({
						url: url
					})
				} else {
					uni.navigateTo({
						url: url
					})
				}

			},
			load: function(type) {

				this.getGalleryList(type);

			},


			getGalleryList(type) {
				var that = this;
				if (type == "reload") {
					that.gallery = {};

				}

				this.loadingType = 'loading';
				beeApp.api(
					'sns/material-list/find', {

						id: this.id,

					},
					function(res) {

						if (res.code != 200) {
							that.loadingType = 'more';
							beeApp.alert(res.msg);
							return;
						}
						that.gallery = res.data;
						uni.setNavigationBarTitle({
							title: res.data.content_data.name
						})


					}
				);
			},


		}
	};
</script>

<style lang="scss">
	.cover {
		width: 100%;
	}

	.line {
		width: 100%;
		border-bottom: 1px solid #EEEEEE;
	}

	.bottom-fix-h {
		height: 80px;
	}

	.bottom-fix {
		position: fixed;
		width: 100%;
		bottom: 0px;
		left: 0px;
	}
</style>
